// 主界面
;define(function(require, exports, module) {
    'use strict';
   var util = require("util");
	var base = require("base");
	var router = require("../hash/pageRouter");
	var top = require("../top/top_main");
	var footer = require("../footer/footer_main");
    var pageIndex = 1,
		pageSize = 10,
		totalPageCount = 1,
		totalRecordCount = 0; //分页初始化
     var css_publicInquireMain = require("./publicInquireMain.css");
    var init = function(){
    	top.init();
		footer.init();
		$("#publicInquire").addClass("nav_active");
		$("#content .w1366 div span").removeClass("active_topNav");
		$("#bulkstockPledge").addClass("active_topNav");
		$("#head").removeClass("none");
		$("#content").removeClass("none");
		$("#footer").removeClass("none");
    	router.init();
    	inquirePublicFinanceBulkstockPageList();
		initEvent(); 
    };
    
	var initEvent = function(){
		
    };
    
     //质物列表
     var inquirePublicFinanceBulkstockPageList = function(){
		base.fnAjax({
			action: "inquirePublicFinanceBulkstockPageList.json",
			nocode: true,
			async: false,
			oData: {
				pageIndex: pageIndex,
				pageSize: pageSize
            }, //传递参数
            fnSuccess: function(data) {
                if (data.status == 200) {
                	var tpl = $("#pledgeListTpl").html();
                	var html = juicer(tpl, data);
                	$("#pledgeListBody").html(html);
                	totalPageCount = data.totalPageCount;
					totalRecordCount = data.totalRecordCount;
                	base.pageControl($("#publicInquirePledge .pagerCon"),
						totalRecordCount,
						data.pageIndex,
						data.pageSize,
						function(p) {
							pageIndex = p;
							inquirePublicFinanceBulkstockPageList();
						});
                } else {
//                  base.alert(2,"信息获取失败");
                }
            }
		});
	};
    

    return {
        init:init
    };
});